using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CodePlex.SpaceBlock.UI.Controls
{
    public partial class ProgressControl : CodePlex.SpaceBlock.UI.Controls.BaseControl
    {
        public ProgressControl()
        {
            InitializeComponent();

            _progressBar.TabStop = false;
        }

        public void SetProgressText(string format, params object[] args)
        {
            if (this.InvokeRequired)
            {
                this.InDisplay(delegate
                {
                    this.SetProgressText(format, args);
                });
            }

            _progressText.Text = string.Format(format, args);



        }

        public void SetProgress(int value, int max)
        {
            if (this.InvokeRequired)
            {
                this.InDisplay(delegate
                {
                    this.SetProgress(value, max);
                });
            }

            _progressBar.Maximum = max;
            _progressBar.Value = value;

        }

        private void _progressBar_Click(object sender, EventArgs e)
        {

        }
    }
}

